//枚举类型
//就是将一组可能出现的值, 一个一个列举出来, 定义在一个类型中,这个类型就是枚举类型

//枚举类型放常量 字符串 数字 (全大写)
enum Direction {
    LEFT = "LEFT",
    RIGHT = "11",
    TOP = "1111",
    BOTTOM = 100
}
enum Url {
    DEV_URL = "www.baidu.com",
    PROD_URL = "www.baidu.com1",
    TEST_URL = "www.baidu.com2"
}

let a:Direction = Direction.LEFT;

function move(direction: Direction){
    console.log(direction)
    switch (direction){
        case Direction.LEFT:
            console.log("向左移动")
            break;
        case Direction.RIGHT:
            console.log("向右移动")
            break;
        case Direction.TOP:
            console.log("向上移动")
            break;
        case Direction.BOTTOM:
            console.log("向下移动")
            break;
        default:
            let err:never = direction
    }
}
move(Direction.LEFT)
move(Direction.RIGHT)
move(Direction.TOP)
move(Direction.BOTTOM)
// move(null)